package com.cipta.lomob.adapter;

import java.util.ArrayList;


import com.cipta.lomob.fragments.PopularVideoFragment;
import com.cipta.lomob.model.ItemVideo;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class PopularVideoFragmentAdapter extends FragmentStatePagerAdapter {
    private final int mSize;
    private ArrayList<ItemVideo> listItem;
    
    public PopularVideoFragmentAdapter(FragmentManager fm, ArrayList<ItemVideo> listItem) {
        super(fm);
        this.listItem = listItem;
        mSize = listItem.size();
    }
    
    @Override
    public int getCount() {
        return mSize;
    }

    @Override
    public Fragment getItem(int position) {
        return PopularVideoFragment.newInstance(listItem.get(position));
    }
}
